package com.csce.domain.entity.score.socket;

/**
 * @author zzxjs
 * @since 2023/11/17
 */
public enum ExPlaceEnum {

    CTRL("ctrl"),//控制端
    SHOW("show"),//展示端
    WAITING_HALL("waiting_hall"),//候考大厅展示端
    EX_PLACE_DOOR("ex_place_door"),//考站门口展示端
    ORDER("order"),//指令
    ROLE("role"),//角色
    //UPDATE_SESSION_INFO("update_session_info"),//刷新房间配置
    UPDATE_WAITING_USERS("update_waiting_users"),//刷新房间候考人员
    NEXT_STUDENT("next_student"),//下一位
    CALL_CODE("call_code"),//叫号
    TODAY_EXAM_LIST("today_exam_list"),//查询今日的考试列表
    UPDATE_CONNECT_DATA("update_connect_data"),//更新今日的考试列表
    GET_EXAM_TODAY_BY_ID("get_exam_today_data_by_id"),//根据考试id获取考试的详情，包括日期房间等信息
    SELECT_SHEET("select_sheet"),//查询评分表
    SAVE_MARK("save_mark"),//保存分数
    CHOOSE_TIME("choose_time"),//选择考试时间
    CHOOSE_EXAM("choose_exam"),//选择考试房间
    CTRL_INSTRUCT("instruct@"),//
    ;

    private final String value;

    ExPlaceEnum(String order) {
        this.value = order;
    }

    public String value() {
        return value;
    }

    public boolean equals(String str) {
        return this.value().equals(str);
    }

    public static boolean isCtrl(String role) {
        return CTRL.equals(role);
    }

    public static boolean isShow(String role) {
        return SHOW.equals(role);
    }

    public static boolean isDoor(String role) {
        return EX_PLACE_DOOR.equals(role);
    }

    public static boolean isWaitingHall(String role) {
        return WAITING_HALL.equals(role);
    }

    public static boolean isCtrlInstruct(String order) {
        return order.startsWith(CTRL_INSTRUCT.value());
    }
}
